UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nV3YBdiZjJikv1BWi0Xod7EMtL49L8IBpQeeRfNZmI8='
WHERE
key_id = 'c04cc40b37724d746789ff2e0b7a33afaa1cc384d05def9a5158f1a6cd5cf8b6'
AND (
token = 'nV3YBdiZjJikv1BWi0Xod7EMtL49L8IBpQeeRfNZmI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)