UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g8s+lF9QE7PY422ChRHqs0A7yce9UXLy8dVGbb4nLkk='
WHERE
key_id = 'ab089f4783bb5e52a4409e54cd62880dd6a4309f812132b5bf7c64fd0fd7c755'
AND (
token = 'g8s+lF9QE7PY422ChRHqs0A7yce9UXLy8dVGbb4nLkk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)