UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '685+r5Jm/SOsuO0n2dP+ss3QgyUSfV2wmRwARSO98H0='
WHERE
key_id = '3f80b4e2b9dc79832d8f307cdf2d6d42aca344943ccdd9ff0da35e11a17118f0'
AND (
token = '685+r5Jm/SOsuO0n2dP+ss3QgyUSfV2wmRwARSO98H0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)