UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y3knn+vzBqfZgvTGmmTjsNwZa5mSaFGxO/xBQKV4u1k=' 
WHERE 
  key_id = '1a8f247d1be8fe324fd2aab2c72b09ddd793965d2a7203edbc9c69cce00a202a' 
  AND (
    token = 'y3knn+vzBqfZgvTGmmTjsNwZa5mSaFGxO/xBQKV4u1k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00086