UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XQANRnnLTCNHr8JvRUhi0tkgdSwLm9GBkQymYLdwO98='
WHERE
key_id = '4222a8790e910f6ab7eaa8f8dcf468c4ace7eac42202ea2df4a6c44071807f94'
AND (
token = 'XQANRnnLTCNHr8JvRUhi0tkgdSwLm9GBkQymYLdwO98='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)