UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '89zP+aYBWrBA5+ewaIYUYXU2/LQ7+sK8fqiP8Py727g=' 
WHERE 
  key_id = '180b98671192ef3cd592fb83b36c15f2e0b8a23dc56e06af8bdb07b0cc90d217' 
  AND (
    token = '89zP+aYBWrBA5+ewaIYUYXU2/LQ7+sK8fqiP8Py727g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058