UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XhX3I67uEKkiSTVlMz0/yHBr/6G6HQrCTritbJCy4mM='
WHERE
key_id = '325420ef12d60955c5059ee450edfc1db3b9a10bdc89e6ae6518ef15feb4a36f'
AND (
token = 'XhX3I67uEKkiSTVlMz0/yHBr/6G6HQrCTritbJCy4mM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)