UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fZk8VQuhLK9Y/c9xeL0T70V7CgGD4Pnay2/ly4OyI48='
WHERE
key_id = '74c1d7225113fe5daafeb6ff1f5decef36d66027549df811f8f795d382157ec3'
AND (
token = 'fZk8VQuhLK9Y/c9xeL0T70V7CgGD4Pnay2/ly4OyI48='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)