UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8z2ixLeRQkBQACsQIyqHoKV/4oFdOgfAEAvZjnF5zes=' 
WHERE 
  key_id = 'd3be755877dc532eaff83ed07a5bec153cfb722034fbd5fba018eec07fafd7e1' 
  AND (
    token = '8z2ixLeRQkBQACsQIyqHoKV/4oFdOgfAEAvZjnF5zes=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056