UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PriMCqZzYwOchUHFXHn9vJs0Zgyn3d3Eas+C1032hSg=' 
WHERE 
  key_id = '2215ed9a7d314ffef68f65163a973d86b4f1dd348e3ac493241b99b055c6ff25' 
  AND (
    token = 'PriMCqZzYwOchUHFXHn9vJs0Zgyn3d3Eas+C1032hSg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029