UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QY2hA6gD0dWh/s6JPZcCmJNj3/Lseykw0roFYGPfCOQ='
WHERE
key_id = '764356ca19e958be81d93f5c29ac85887524e764614f8067a4cc1a4067789afb'
AND (
token = 'QY2hA6gD0dWh/s6JPZcCmJNj3/Lseykw0roFYGPfCOQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)