UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '13EGVW/XVXZOBMu0yebczuqC4fDX6TbpnWd1kvY90MY='
WHERE
key_id = '531f305589aa7a19a322aefe9dd698f5e432c656ea3d51ed8faa8877d2c68df7'
AND (
token = '13EGVW/XVXZOBMu0yebczuqC4fDX6TbpnWd1kvY90MY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)