UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NwCUJk65sI7cW81MljVxuRjiQr/Uh9m4pDzFMhD9ox0=' 
WHERE 
  key_id = 'b9d6bf65f4848f2ca9b81a52604d893cdedc1ce28d545a4a63c9e82b70592c68' 
  AND (
    token = 'NwCUJk65sI7cW81MljVxuRjiQr/Uh9m4pDzFMhD9ox0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034