UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aIzFO0GpWavM8zZh5nWAZv4VAzScN5DYtKC2I5IFryM=' 
WHERE 
  key_id = '5fd311a81edfb059f73d0d65f3d1a842363017b8aa92c638e0e93d772ead3602' 
  AND (
    token = 'aIzFO0GpWavM8zZh5nWAZv4VAzScN5DYtKC2I5IFryM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042