UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2V0GRWnoY4SP0uIBdGbKnuK6Zmjw2sj17ONJXgtvPmo='
WHERE
key_id = '0a76521602ff11ffc9b1ec152c00a8854344dcf6f6b0308dba05d4049f269105'
AND (
token = '2V0GRWnoY4SP0uIBdGbKnuK6Zmjw2sj17ONJXgtvPmo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)