UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VQdI07BLn5VMIpdGpBl2GvDCcevT/P1X9ptkEvTZO+c='
WHERE
key_id = '3c61fbd3f3e38d26c5f207b749122ed6ce0acaab5032778922eb43dcdddcbfcf'
AND (
token = 'VQdI07BLn5VMIpdGpBl2GvDCcevT/P1X9ptkEvTZO+c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)