UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X58yXTCvOkNVTCQsO9CpR5j7UnRUDYdjUQbz2w7ckL0='
WHERE
key_id = '54188873d4b0ee2895662508fd57cbf9c9daa99318e34cc42d31df3c763efad8'
AND (
token = 'X58yXTCvOkNVTCQsO9CpR5j7UnRUDYdjUQbz2w7ckL0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)