UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kcpOzyISJnmA/iweGmZaxG3ZteEKTMrOpuKFMDVhOE0=' 
WHERE 
  key_id = '08ba92a13f0d31a6dccb719d1c84692866f3d8ccda333ad4e934665615176b17' 
  AND (
    token = 'kcpOzyISJnmA/iweGmZaxG3ZteEKTMrOpuKFMDVhOE0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031