UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dmzeXat8W52TOsytHp1b5XyJN1eGV/hQ2vkOtwnpLyQ=' 
WHERE 
  key_id = '27eb0d3abf4d4746915512cd4e51b81ea2d37ea16bfd8d0e2e6a37d9f8dd9772' 
  AND (
    token = 'dmzeXat8W52TOsytHp1b5XyJN1eGV/hQ2vkOtwnpLyQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031