UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SlwJHVL+cpfvAe4mffy1QDBUKmJSdOhYjvoNVlXut0o='
WHERE
key_id = '88563bfee82bbbd7b88db64724d08edb26df7e0d5c8e3ccfa1c2367fa4de4cbd'
AND (
token = 'SlwJHVL+cpfvAe4mffy1QDBUKmJSdOhYjvoNVlXut0o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)