UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nfgcXf+eP1r/JW1qanSEW0bMQmC8/0avNAPqsGg+6F8='
WHERE
key_id = '193f4473ea88e71641b6e4b29b05635e8afbc4fdcdd90a32135a7a5b9275e4d9'
AND (
token = 'nfgcXf+eP1r/JW1qanSEW0bMQmC8/0avNAPqsGg+6F8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)