UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Y8hmptHrFSWycp7cPUr1Wkq3HKvQ64/hoH5YF7o8e4='
WHERE
key_id = 'ce5f7936409764cd7df88a96e2143fdfd03aae3dae75fb476fb7c16f024e3186'
AND (
token = '4Y8hmptHrFSWycp7cPUr1Wkq3HKvQ64/hoH5YF7o8e4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)