UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hFn+luVTebWhYSF/3o3Y8DEWZyOMz0Es507o9mCJdS4=' 
WHERE 
  key_id = '238f2643805de79ac464b60b6e9a4afa97e92cbf910bfea809406bc26867a68a' 
  AND (
    token = 'hFn+luVTebWhYSF/3o3Y8DEWZyOMz0Es507o9mCJdS4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045