UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pj1b2sLAd+xAsAIbdDLaxyksEijV+MmK5goIeU3G70w='
WHERE
key_id = '3aad418492d0ce10005354925f90e8dcdc21e2b575b207ee201a2046bf83e701'
AND (
token = 'pj1b2sLAd+xAsAIbdDLaxyksEijV+MmK5goIeU3G70w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)