UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zC461ObQXgyERWGEVmXhXGHGodicy2S8UVAsz+E/QBw='
WHERE
key_id = 'b3bd0f1e01105176b05e1100cb91f5a937bb1eadf2ea284b8625d5d0ec6d7413'
AND (
token = 'zC461ObQXgyERWGEVmXhXGHGodicy2S8UVAsz+E/QBw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)