UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/ywMRHKLt13k14XFeFiSpNzNPx2Zx5uXcbvXEMW8hd4=' 
WHERE 
  key_id = 'f8998ddd38f6a8e6d7b1e8d78a301de3f440665017391bc21eec13af4ce738b9' 
  AND (
    token = '/ywMRHKLt13k14XFeFiSpNzNPx2Zx5uXcbvXEMW8hd4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028