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

Query time 0.00034