UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IzsMPjYHrU3HOEMYqI7Vf/mLxiYxTHsVRIi7tUKEiC4=' 
WHERE 
  key_id = 'abf8ddedb396a89eed64aa8cd35ba85f6693835bcddacd728fa8d42bbdaf0016' 
  AND (
    token = 'IzsMPjYHrU3HOEMYqI7Vf/mLxiYxTHsVRIi7tUKEiC4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047