UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4zsjkm6KsuPxb+o3H2BW6tf/UvoLCdI7wzQ4j1ncyhI=' 
WHERE 
  key_id = 'f779916ca0af25b8b8b5e3aefe20cade31d105372521c7eb8f425f4ab6d1991c' 
  AND (
    token = '4zsjkm6KsuPxb+o3H2BW6tf/UvoLCdI7wzQ4j1ncyhI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026