UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '78gStZl6jbtRcZAA01L6Ea/JS6CGr/awKnZPVRPabyU='
WHERE
key_id = 'bdc490528ce6185e3c61ee3488b56f123c2181a134c2d349428f99403edfb51e'
AND (
token = '78gStZl6jbtRcZAA01L6Ea/JS6CGr/awKnZPVRPabyU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)