UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3DwNwoDteDeHT/CaleVrNbjsHQgtIzeWxOKVfaC5F2w=' 
WHERE 
  key_id = 'edd446e7224bb69f97a24a33e21407c6df5f9810a522be9d3dbd6e470483ca12' 
  AND (
    token = '3DwNwoDteDeHT/CaleVrNbjsHQgtIzeWxOKVfaC5F2w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018