UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ob6aqdL4vo0k4qVGFxENA+nzuqPuIKQ8LPz6OTnWCoI='
WHERE
key_id = '475fdaed2438819569e57e99f6b4d59f835e24177db1dff0172ca201380282b0'
AND (
token = 'ob6aqdL4vo0k4qVGFxENA+nzuqPuIKQ8LPz6OTnWCoI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)