UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2vP9esv1Jgn/obEuMtDIArh39xP3bSA/CE4JHshbras=' 
WHERE 
  key_id = '51e837c8f2016a5c6e52a88cc7a96f470c41e72653e1d227757a56d83e5f64c8' 
  AND (
    token = '2vP9esv1Jgn/obEuMtDIArh39xP3bSA/CE4JHshbras=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036