UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n9Xo/ZOO0uw8mj273s959GGlgp3ev9QMCFCZeBtqmA4=' 
WHERE 
  key_id = '3dd8e8ff1e5f3cdb845785ecea0225109bde32d5b32b7454f5700f46c049f5e9' 
  AND (
    token = 'n9Xo/ZOO0uw8mj273s959GGlgp3ev9QMCFCZeBtqmA4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045