UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2di4z7t/5HybE1wIL70VX21caCnYcGbCfFICuGIT1F4='
WHERE
key_id = '702110e1c89ec3e8709b0f80985b3fe59df64a42ef48042b69c6898ca0cee794'
AND (
token = '2di4z7t/5HybE1wIL70VX21caCnYcGbCfFICuGIT1F4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)