UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pou+ZLQCGhVKemMWUhz7BkFePMRgjACWLEpUxLO9NoM='
WHERE
key_id = 'eb4d6808da429eca9df0388cf4541f269c87533907e4e57ab8f18a403d6e422b'
AND (
token = 'pou+ZLQCGhVKemMWUhz7BkFePMRgjACWLEpUxLO9NoM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)