UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wT5mTB1w9ACALqrV4BJI3/wGLyWKhvqzp9gRHe++vp8=' 
WHERE 
  key_id = '70b147f7c681703f73b7bc41279b5fbf35e241daa69eddeacab10d07c09a747c' 
  AND (
    token = 'wT5mTB1w9ACALqrV4BJI3/wGLyWKhvqzp9gRHe++vp8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030