UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OYp570Q9RRl7PRXiSmZnZGl+R63iouWnlPWgM/eSXT0='
WHERE
key_id = '5ff97f5b7ff56c249616bb03ec5111f3cd157d271ce2af4fb90e55d363ad8904'
AND (
token = 'OYp570Q9RRl7PRXiSmZnZGl+R63iouWnlPWgM/eSXT0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)