UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w+CzSDWexLGiRWQoBZ3a+ozYPxGbg81d++oRXv9KbNo='
WHERE
key_id = 'a426480b96b479415c8a1d3d0f8bc0e9515f51c7966a6ee6c5ab4961c558288f'
AND (
token = 'w+CzSDWexLGiRWQoBZ3a+ozYPxGbg81d++oRXv9KbNo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)