UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JngM9HjxDaqFUuYtNx574rqTrN0Jw8k6FHO11lycKpU='
WHERE
key_id = 'ce6f8f4b7c7aa76a56c4ad1c41e6d985d0281c9203d812dfd6bac992c4186f52'
AND (
token = 'JngM9HjxDaqFUuYtNx574rqTrN0Jw8k6FHO11lycKpU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)