UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OxuFmpuvpHcVY3xYJ44xQfzXvBztEjzS5KR+9X6/VF0=' 
WHERE 
  key_id = 'ccabfa5e7660993d5f45cc4f07e14474c3a68f029147c0023763425fe3131a0b' 
  AND (
    token = 'OxuFmpuvpHcVY3xYJ44xQfzXvBztEjzS5KR+9X6/VF0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020