UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gVdI1hmy5O0nlF8TFPrNRIcOjWZpM/ilkJwraNmHFD0='
WHERE
key_id = '628db33ca9e37fabb013ae563ab060524ee2d2d82d1cd1f30e4a0c534ea7f175'
AND (
token = 'gVdI1hmy5O0nlF8TFPrNRIcOjWZpM/ilkJwraNmHFD0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)